package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysTotalMapper;
import com.ruoyi.system.domain.SysTotal;
import com.ruoyi.system.service.ISysTotalService;

/**
 * 汇总Service业务层处理
 * 
 * @author fengzy
 * @date 2022-04-10
 */
@Service
public class SysTotalServiceImpl implements ISysTotalService 
{
    @Autowired
    private SysTotalMapper sysTotalMapper;

    /**
     * 查询汇总
     * 
     * @param totalId 汇总ID
     * @return 汇总
     */
    @Override
    public SysTotal selectSysTotalById(Long totalId)
    {
        return sysTotalMapper.selectSysTotalById(totalId);
    }

    /**
     * 查询汇总列表
     * 
     * @param sysTotal 汇总
     * @return 汇总
     */
    @Override
    public List<SysTotal> selectSysTotalList(SysTotal sysTotal)
    {
        return sysTotalMapper.selectSysTotalList(sysTotal);
    }

    /**
     * 新增汇总
     * 
     * @param sysTotal 汇总
     * @return 结果
     */
    @Override
    public int insertSysTotal(SysTotal sysTotal)
    {
        sysTotal.setCreateTime(DateUtils.getNowDate());
        return sysTotalMapper.insertSysTotal(sysTotal);
    }

    /**
     * 修改汇总
     * 
     * @param sysTotal 汇总
     * @return 结果
     */
    @Override
    public int updateSysTotal(SysTotal sysTotal)
    {
        return sysTotalMapper.updateSysTotal(sysTotal);
    }

    /**
     * 批量删除汇总
     * 
     * @param totalIds 需要删除的汇总ID
     * @return 结果
     */
    @Override
    public int deleteSysTotalByIds(Long[] totalIds)
    {
        return sysTotalMapper.deleteSysTotalByIds(totalIds);
    }

    /**
     * 删除汇总信息
     * 
     * @param totalId 汇总ID
     * @return 结果
     */
    @Override
    public int deleteSysTotalById(Long totalId)
    {
        return sysTotalMapper.deleteSysTotalById(totalId);
    }
}
